
#ifndef WXSANGULARMETER_H
#define WXSANGULARMETER_H

#include "wxwidgets/wxswidget.h"


class wxsAngularMeter : public wxsWidget
{
	public:
		wxsAngularMeter(wxsItemResData* Data);
		virtual ~wxsAngularMeter();
	protected:
	private:
        virtual void OnBuildCreatingCode();
        virtual wxObject* OnBuildPreview(wxWindow* Parent,long Flags);
        virtual void OnEnumWidgetProperties(long Flags);

		long						m_iValue;					
		long						m_iNumTicks;			
		bool						m_bShowVal;			
		long						m_iRangeMin;			
		long						m_iRangeMax;			
		long						m_iAngleMin;			
		long						m_iAngleMax;			
		long						m_iNumSectors;		
		wxsColourData	m_cdNeedleColour;		
		wxsColourData	m_cdBorderColour;		
		wxsColourData	m_cdBackgroundColour;
		wxsFontData		m_fnt;							

        // Dynamic properties.
        
        struct SectorDesc{
            wxPGId id;										
			wxColour	colour;								
//			wxsColourData	cd;
        };
        WX_DEFINE_ARRAY(SectorDesc*, SectorArray);

        SectorArray m_arrSectors;						
        wxPGId m_SectorCountId;						

        void OnAddExtraProperties(wxsPropertyGridManager* Grid);
        void OnExtraPropertyChanged(wxsPropertyGridManager* Grid,wxPGId id);
        bool OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra);
        bool OnXmlWrite(TiXmlElement* Element,bool IsXRC,bool IsExtra);
		void InsertPropertyForSector(wxsPropertyGridManager* Grid,int Position);
		bool HandleChangeInSector(wxsPropertyGridManager* Grid,wxPGId id,int Position);

};

#endif // WXSANGULARMETER_H
